<?
	if(isset($_GET['cid'])){
		$cid = intval($_GET['cid']);
		$rs = $db->query("SELECT * FROM ".$prefix."loaisanpham WHERE c_id = '".$cid."' AND c_hienthi = 1");
		if($db->num_rows($rs) != 0){
			$row = $db->fetch_array($rs);
			
			if($row[c_id_cha] == 0){
				$cat_name = stripslashes($row[c_ten]);
				$cat_id = $row[c_id];
			}else{
				$cat_id = $row[c_id_cha];
				$rs2 = $db->query("SELECT * FROM ".$prefix."loaisanpham WHERE c_id = '".$cat_id."' AND c_hienthi = 1");
				$row2 = $db->fetch_array($rs2);
				$cat_name = stripslashes($row2[c_ten]);
			}
		}else{reHome($urlHome);}
	}else{reHome($urlHome);}
?>
<div id="menuleft" class="menucategory">
    <div class="category-header-right menucategory">
        <div class="category-header-left">
            <div class="category-header-bg" style="text-align:left;padding-left:20px">
                <p><?=$cat_name?></p>
            </div>
        </div>
    </div> 
    <div class="corner-round-05-top-right">
		<div class="corner-round-05-top-left"><div class="corner-round-05-top-bg"></div></div>
	</div>

    <div class="corner-round-05-body">        
        <div id="product-category">            
                                
                    
                            <div style="padding-top:5px;"></div>
                        <?
							$rs = $db->query("SELECT * FROM ".$prefix."loaisanpham WHERE c_id_cha = '".$cat_id."' AND c_hienthi = 1");
							while($row = $db->fetch_array($rs)){
						?>
                            <div class="category-items-filters">
                               <?
							   		if($cid == $row[c_id]){
							   ?>
							    <span><?=stripslashes($row[c_ten]);?></span>                                
								<? }else{ ?>
								
								<span><a href="<?=$root?>/danh-muc-san-pham/<?=$row[c_id]?>/<?=$myString->vietdecode($row[c_ten])?>"><?=$row[c_ten]?> (<?=LaySoLuongSanPham($row[c_id])?>)</a></span>
								
								<? }?>
                            </div>                    
                         
						 <? } ?>           
                                               
        </div>
        <div style="height:10px"></div>        
    </div>
    <div class="corner-round-05-bottom-right">
        <div class="corner-round-05-bottom-left">

            <div class="corner-round-05-bottom-bg"></div>
        </div>
    </div>
    <br style="font-size:0px;" />
</div>